package com.duqc.web.controller;

import com.duqc.web.dto.ShardingSphereDTO;
import com.duqc.web.service.ShardingSphereService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName ShardingSphereController
 * @Description TODO
 * @Author duqc
 * @Date 2021/4/7
 **/
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/shardingsphere")
public class ShardingSphereController {

    private final ShardingSphereService shardingSphereService;

    @PostMapping("/add")
    public void addInfo(@RequestBody ShardingSphereDTO shardingSphereDTO) {
        this.shardingSphereService.addInfo(shardingSphereDTO);
    }

    @GetMapping("/list")
    public List<ShardingSphereDTO> listInfo() {
        return this.shardingSphereService.listInfo();
    }

}
